<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Main.Master" Inherits="System.Web.Mvc.ViewPage<Profile>" %>

<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="raya.Models.notifications" %>
<%@ Import Namespace="raya.Library.Extensions" %>
<%@ Import Namespace="raya.Library" %>
<%@ Import Namespace="raya.Models.people" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="mainContentWide">
        <div id="home_content">
            <ul>
                <li><a href="#activities">Activities</a></li>
                <li><a href="#notifications">Notifications</a></li>
                <li><a href="#applications">Applications</a></li>
            </ul>
            <div id="notifications">
                <% if (ViewData.Model.newFriends != null)
                   {
                       Html.RenderControl(rayaControls.notifications_friend, ViewData.Model.newFriends);
                   }%>
                <div class="clear">
                </div>
                <% if (ViewData.Model.notifications != null)
                   {
                       Html.RenderControl(rayaControls.notifications, ViewData.Model.notifications);
                   }%>
            </div>
            <div id="activities">
                <%
                    Html.RenderControl(rayaControls.activities, ViewData.Model.activities);%>
            </div>
            <div id="applications">
                <%
                    Html.RenderControl(rayaControls.applications, ViewData.Model); 
                %>
            </div>
        </div>
    </div>
    <div class="sideBar">
        <%if (ViewData.Model.notifications != null)
          {
              Html.RenderControl(rayaControls.notify, ViewData.Model.notifications.count);
          }
          //Html.RenderControl(ejControls.apps_fav, null); 
        %>
        <%if (ViewData.Model.is_owner)
          {%>
        <div class="sidebox">
            <div class="gadgets-gadget-title-bar">
                Facebook Connect</div>
            <% if (Session["fbuid"] != null)
               {
                   if ((long)Session["fbuid"] == 0)
                   { %>
            <p>
                Connect raya with your Facebook account to share your information and see which
                of your friends are here.</p>
            <p class="ac">
                <fb:login-button length="short" background="light" size="medium" onlogin="facebook_onlogin_ready();">
                </fb:login-button>
            </p>
            <%}
                   else
                   {
                       if (ViewData.Model.unconnectedFBFriendsCount != 0)
                       {
                           string inviteLink = "<a href=\"#\" onclick=\"FB.Connect.inviteConnectUsers(); return false;\"> Unconnected friends</a>";
            %>
            <p>
                <%= ViewData.Model.unconnectedFBFriendsCount + " " + inviteLink%>
            </p>
            <%}%>
            <p>
                <img src="http://static.ak.fbcdn.net/images/icons/favicon.gif" alt="fb" />
                <a href="#" onclick="fb_disconnect();">Disconnect from Facebook</a></p>
            <%  }
               }%>
        </div>
        <%} %>
        <div class="sidebox">
            <div class="gadgets-gadget-title-bar">
                Expand your network</div>
            <ul class="ul1">
                <li><a href='/contacts/add'>Invite friends</a></li>
                <li><a href='/contacts/search'>Find friends</a></li>
            </ul>
        </div>
    </div>

    <script type="text/javascript">
        $(document).ready(function() {
            var $tabs = $('#home_content').tabs();
            if (querySt('tab') != undefined) {
                $tabs.tabs('select', '#' + querySt('tab'));
            }
        });
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <link href="/Content/uploader.css" rel="stylesheet" type="text/css" />
</asp:Content>
